package com.windchime.blog.entity;

import com.baomidou.mybatisplus.annotation.*;

import java.util.Date;
import java.io.Serializable;
import java.util.List;

import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * <p>
 * 评论表
 * </p>
 *
 * @author WindChime
 * @since 2021-08-05
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("t_comment")
public class Comment implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 评论ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 一级ID
     */
    private Integer parentId;

    /**
     * 博客ID
     */
    private Integer blogId;

    /**
     * 管理员ID
     */
    private Boolean adminId;

    /**
     * 评论人ID
     */
    private Integer userId;

    /**
     * 评论内容
     */
    private String content;

    /**
     * 创建时间
     */
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    /**
     * 二级评论
     */
    @TableField(exist = false)
    private List<Comment> replyComments;

    /**
     * 父评论
     */
    @TableField(exist = false)
    private Comment parentComment;

    /**
     * 父评论用户ID
     */
    @TableField(exist = false)
    private Integer parentUserId;

    /**
     * 评论用户
     */
    @TableField(exist = false)
    private String userName;

    /**
     * 管理员用户
     */
    @TableField(exist = false)
    private String adminName;

    /**
     * 父评论用户
     */
    @TableField(exist = false)
    private String parentUserName;


    /**
     * 博客后台所用
     */
    @TableField(exist = false)
    private String blogName;
    @TableField(exist = false)
    private Boolean parentOff;
    @TableField(exist = false)
    private Boolean adminOnOrOff;
    @TableField(exist = false)
    private String commentator;

}
